package model.components.links.factory;

import model.components.links.link.Link;

import org.apache.commons.collections15.Factory;

public class LinksFactory implements Factory< Link >
{	
	private String networkName;
	public String getNetworkName(){ return networkName; }
	public void setNetworkName( String networkName ){ this.networkName = networkName; }

	private int minBandwidth;
	public int getMinBandwidth(){ return minBandwidth; }
	public void setMinBandwidth( int minBandwidth ){ this.minBandwidth = minBandwidth; }
	
	private int maxBandwidth;
	public int getMaxBandwidth(){ return maxBandwidth; }
	public void setMaxBandwidth( int maxBandwidth ){ this.maxBandwidth = maxBandwidth; }
		
	protected int linkCount;
	public int getLinkCount(){ return linkCount; }
	public void setLinkCount( int linkCount ){ this.linkCount = linkCount; }

	public LinksFactory( String networkName, int minBandwidth, int maxBandwidth )
	{
		this.setNetworkName( networkName );
		this.setMinBandwidth( minBandwidth );
		this.setMaxBandwidth( maxBandwidth );
	}
	
	@Override
	public Link create()
	{
		return null;
	}
	
	protected int randomBandwidth()
	{
		return this.getMinBandwidth() + (int)( Math.random() * ( this.getMaxBandwidth() - this.getMinBandwidth() + 1 ) );
	}
	
}
